Mapping With more Data - FEMA

Ricky

11/10/2020

Introduction

In this project, we are going to create our own interactive map to take a look at the public assistance program summary data from FEMA.
the interactive map on FEMA's website

the interactive map on FEMA’s website

Load data

We downloaded FEMA data from this link: https://www.fema.gov/openfema-data-page/public-assistance-funded-projects-details-v1

This .csv file include detailed public assistance funded projects information. We selected the the Sever Storm(s), Hurricane and Coastal Storm incident-types in 2009-2018 for this analysis.

Dateset

This dataset is prepared for county-level plot.

DisasterNum Year Incident State County ProjectAmount FederalShareObligated ToatlObligated
1871 2010 Severe Storm(s) North Carolina Madison 5356.79 4017.59 4017.59
1871 2010 Severe Storm(s) North Carolina Madison 5163.41 3872.56 3872.56
1871 2010 Severe Storm(s) North Carolina Madison 13811.83 10358.87 10358.87
1871 2010 Severe Storm(s) North Carolina Madison 3765.00 2823.75 2823.75
1871 2010 Severe Storm(s) North Carolina Madison 12318.38 9238.79 9238.79
1871 2010 Severe Storm(s) North Carolina Madison 7488.04 5616.03 5616.03

Here are some explanation from FEMA website:

projectAmount(“Project Amount”): The estimated total cost of the Public Assistance grant project in dollars, without administrative costs. This amount is based on the damage survey.

federalShareObligated(“Federal Share Obligated”): The Public Assistance grant funding available to the grantee (State) in dollars, for sub-grantee’s approved Project Worksheets.

totalObligated(“Total Obligated”): The federal share of the Public Assistance grant eligible project amount in dollars, plus grantee (State) and sub-grantee (applicant) administrative costs. The federal share is typically 75% of the total cost of the project.

Mapping

In this plot, we take all years(2009-2018) data, calculated the summary of obligated amount of each county.

# total obligated amount in thousands
hrccJ <- hrcc %>% group_by(Fips) %>% 
  summarise(state = unique(state), county = unique(county), 
            TotalAmount = sum(totalObligated)/1000,
            .groups = "drop") %>%
  rename(GEO_ID = Fips)

Outliers

In order to give an obvious plot of each county, we delete some outlier points.

# outliers
outliers <- hrccJ %>% filter(TotalAmount %in% outValue)
hrccJ <- hrccJ %>% filter(!(TotalAmount %in% outValue))
kable(head(outliers),"html",align = "c")
GEO_ID state county TotalAmount
01003 Alabama Baldwin 13845.087
01015 Alabama Calhoun 7403.059
01039 Alabama Covington 5297.541
01043 Alabama Cullman 13460.415
01049 Alabama DeKalb 6700.742
01059 Alabama Franklin 19455.656

Popups

Also add some popups to show the State, County and Total amount(in thousands).

# popup 
i_popup <- paste0("<strong>State: </strong>", 
                  hrccJoin$state, "<br>", 
                  "<strong>County: </strong>", 
                  hrccJoin$county, "<br>", 
                  "<strong>Total Obligated Amount: </strong>",
                  round(hrccJoin$TotalAmount,2) ,
                  " ","thousands") 

Leaflet map

Plot the leaflet.

Inference:

Leaflet css file: Per Liedman

https://gist.github.com/perliedman/9d42f6d1d6583e882df7ae9e95252c0d